<section>
    <div class="container"><div class="row">
            <div class="span12">            	
                <ul class="breadcrumb">
                    <li class="previous"><a href="<?php echo SITE_URL; ?>">Home /</a></li>                        
                    <li class="disable"><a href="javascript:void(0);">Compare</a></li>
                </ul>                    
            </div>
            <div class="span12">
                <div class="whiteBg padding20px addmarginB20">                   
                    <h5 class="fnt-size20">Compare Classes / Courses</h5>                        
                </div>                                   

                <div class="row">
                    <div class="compareClass">
                        <ul>  
                            <?php
                            $seatavailable = 0;
                            foreach ($allcompareClasses as $classId) {
                                $classcoursedata = explode("@", $classId);
                                if (isset($classcoursedata[1]) && $classcoursedata[1] == "class") {
                                    $classes = Classes::model()->findByAttributes(array('id' => $classcoursedata[0]));
                                    $class_course_title = $classes->class_titile;
                                    $batchData = ClassBatch::model()->findAll('classes_id=:classes_id', array('classes_id' => (int) $classcoursedata[0]));
                                    $getVenues = Classes::getclassWithVenues($classcoursedata[0]);
                                    $locationName = ClassVenue::getLocationNameByVenueId($getVenues);
                                    $priceRange = ClassBatch::findMinMaxPriceByClassbatchforCategoryPage($classcoursedata[0]);
                                } else {
                                    $classes = Courses::model()->findByAttributes(array('id' => $classcoursedata[0]));
                                    $class_course_title = $classes->course_titile;
                                    $batchData = CourseBatche::model()->findAll('courses_id=:courses_id', array('courses_id' => (int) $classcoursedata[0]));
                                    $getVenues = Courses::getCourseWithVenues($classcoursedata[0]);
                                    $locationName = ClassVenue::getLocationNameBycourseVenueId($getVenues);
                                    $priceRange = CourseBatche::findMinMaxPriceByClassbatchforCategoryPage($classcoursedata[0]);
                                }
                                $imagePath = ($classes->users_id == '') ? 'backend/' . $classes->backend_user_id : $classes->users_id;
                                $imageName = (ClassImage::getPrimaryImage($classcoursedata[0]) != '') ? baseUrl() . '../../' . SkillConfig::getClassCourseImagePath($imagePath) . '240X180/' . ClassImage::getPrimaryImage($classcoursedata[0]) : baseUrl() . '../../' . getUploadDir() . '/no-class-image.jpg';

                                $userType = ($classes->users_id == '') ? 'backend' : '';
                                $classTrainerRate = Classes::trainerPossitiverate($userType, $classes);
                                $userDetails = ($classes->users_id == '') ? Users::getBackEndUser($classes->backend_user_id) : Users::getFrontEndUser($classes->users_id);
                                $trainerResponse = MakeQuery::trainerResponseRate($classes->users_id, $classes->backend_user_id);
                                foreach ($batchData as $batchData) {
                                    $seatavailable = $seatavailable + $batchData->seats;
                                }
                                $classTrainerRate = Classes::trainerPossitiverate($userType, $classes);
                                ?>

                                <li class="span3">
                                    <div class="borAll">
                                        <div class="padding20px">
                                            <?php echo '<img src="' . $imageName . '"  alt="' . $class_course_title . '" id="' . $classes->id . '">'; ?>
                                                                        <!--<img src="images/180x135-class-img-01.png" />-->
                                            <h4><?php echo $class_course_title; ?></h4>                              
                                            <ul>
                                                <li><p>BY <?php echo $userDetails->first_name . '  ' . $userDetails->last_name; ?></p></li>
                                                <li><p>Rs <?php echo $priceRange; ?></p></li>
                                                <li><p class="txtucase"><?php echo $seatavailable; ?> Seats Left</p></li>
                                                <li><p><?php echo $locationName; ?></p></li>
                                                <li><p>Recommendations <?php echo (!empty($classTrainerRate)) ? $classTrainerRate . '% ' : '0% '; ?> Positive</p></li>
                                                <li><p>Response Rate <?php echo (!empty($trainerResponse) ? $trainerResponse . '%' : TRAINER_RESPONSE_RATE); ?></p></li>
                                            </ul>
                                        </div>                        
                                    </div>                       
                                </li> 

                            <?php } ?>                                    
                        </ul>

                    </div>
                </div>

            </div>
        </div></div>
</section>